<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>后台登录</title>

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <script src="<%=request.getContextPath()%>/static/js/jquery-3.4.1.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/static/css/bootstrap.css" />
    <link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/button.css" />
    <script src="<%=request.getContextPath()%>/static/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>

    <style type="text/css">
        #login {
            width: 500px;
            padding: 20px;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translateX(-50%) translateY(-50%);
            background: rgba(255, 255, 255, 0.5);
            border-radius: 4px;
            box-shadow: 5px 5px 20px #444444;
        }

        #login h3 {
            margin-bottom: 30px;
        }

        body{
            background: url(<%=request.getContextPath()%>/static/img/1021.jpg) no-repeat fixed;
            background-size: 100% 100%;
        }
    </style>
    <script type="text/javascript">
        var system ={};
        var p = navigator.platform;
        system.win = p.indexOf("Win") == 0;
        system.mac = p.indexOf("Mac") == 0;
        system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);
        if(system.win||system.mac||system.xll){//如果是电脑跳转到
            window.location.href="#";
        }else{  //如果是手机,跳转到
            window.location.href="index.jsp";
        }
    </script>
</head>
<body>
<div id="login">
    <h3 class="text-center text-muted">登录二次元</h3>
    <form class="form-horizontal" method="post" action="${pageContext.request.contextPath}/user/userLogin" name="loginForm">
        <div class="form-group">
            <label for="userName" class="sr-only">账号：</label>
            <div class="input-group">
                <input type="username" class="form-control input-lg" id="userName" placeholder="账号" name="userName" required>
                <div class="input-group-addon">
                    <span class="glyphicon glyphicon-user"></span>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label for="userPassword" class="sr-only">密码：</label>
            <div class="input-group">
                <input type="password" class="form-control input-lg" id="userPassword" placeholder="密码" name="userPassword" required>
                <div class="input-group-addon">
                    <span class="glyphicon glyphicon-edit"></span>
                </div>
            </div>
        </div>

        <button type="submit" class="btn btn-info btn-block btn-lg">登录</button>

        <div class="box bg-1">
            <button class="button button--antiman button--round-l button--text-medium" onclick="window.open('${pageContext.request.contextPath}/index.jsp')"><span>返回首页</span></button>
        </div>

        <h4 style="color: red;" class="text-center">${error}</h4>


    </form>
</div>
</body>

</html>